<template>
	<view>
		<view class="header">
			<text class="time">任职时间：2021/03/05-至今</text><br>
			<text class="depart">任职部门：学生处</text>
			<text class="address">工作地址：学生处</text>
			<image src="../../static/images/order.png" alt="" class="order" />
			<view class="dataStatistics">
				<view class="title">
					<image src="../../static/images/statistics_icon.png" alt="" />
					<text>数据统计</text>
				</view>
				<view class="mainStatistics">
					<view>
						<image src="../../static/images/time_icon.png" alt="" class="countItem" />
						<text>总工时</text>
						<view class="num"><text>35</text><text>小时</text></view>
					</view>
					<view>
						<image src="../../static/images/canlendar_icon.png" alt="" class="countItem" />
						<text>总班次</text>
						<view class="num"><text>12</text><text>次</text></view>
					</view>
					<view>
						<image src="../../static/images/schedule_icon.png" alt="" class="countItem" />
						<text>请假</text>
						<view class="num"><text>2</text><text>小时</text></view>
					</view>
					<view>
						<image src="../../static/images/clock_icon.png" alt="" class="countItem" />
						<text>迟到</text>
						<view class="num"><text>2</text><text>次</text></view>
					</view>
					<view>
						<image src="../../static/images/canlendar1_icon.png" alt="" class="countItem" />
						<text>缺勤</text>
						<view class="num"><text>2</text><text>次</text></view>
					</view>
				</view>
			</view>

			<view class="echarts">
				<view class="title">
					<image src="../../static/images/echarts_icon.png" alt="" />
					<text>月工时<text style="font-size: 28rpx;">(小时)</text></text>
				</view>
				<view id="postChart" style="width: 100%;height: 500rpx;"></view>
			</view>
		</view>
		<view class="btn" @click="toPage('applyResign')">
			<u-button type="primary" class="leave">离职</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		mounted() {
			this.postChart()
		},
		methods: {
			toPage(url){
				uni.navigateTo({
					url:url
				})
			},
			postChart() {
				let myChart = this.$echarts.init(document.getElementById('postChart'))
				const self = this
				myChart.setOption({
					xAxis: {
						type: 'category',
						data: ['1', '2', '3', '4', '5', '6', '7']
					},
					yAxis: {
						type: 'value'
					},
					series: [{
						data: [150, 230, 224, 218, 135, 147, 260],
						type: 'line'
					}]
				})
			}
		},
	}
</script>

<style scoped lang="scss">
	page {
		background: #FAFAFA;
	}

	.header {
		width: 750rpx;
		height: 248rpx;
		background: #4463CC;
		border-radius: 0px 0px 24px 24px;
		position: relative;
		font-size: 26rpx;
		font-weight: 400;
		color: #FFFFFF;

		.time {
			margin-top: 68rpx;
			margin-left: 32rpx;
		}

		.depart {
			margin-left: 32rpx;
			margin-top: 16rpx;
		}

		.address {
			margin-left: 32rpx;
		}

		.order {
			width: 136rpx;
			height: 150rpx;
			position: absolute;
			top: 58rpx;
			right: 48rpx;
		}

		.dataStatistics {
			width: 91%;
			background-color: #fff;
			margin-left: 32rpx;
			margin-top: 44rpx;
			border-radius: 16rpx;
			padding: 36rpx 24rpx 46rpx 24rpx;

			image {
				width: 36rpx;
				height: 36rpx;
				vertical-align: middle;
			}

			.title {
				font-size: 32rpx;
				font-weight: 500;
				color: #333333;

				&>text {
					margin-left: 14rpx;
				}
			}

			.mainStatistics {
				display: flex;
				flex-wrap: wrap;

				&>view {
					flex: 0 0 33.3%;
					text-align: center;

					&>text {
						font-size: 26rpx;
						font-weight: 400;
						color: #999999;
						margin-left: 6rpx;
						margin-top: 50rpx;
					}

					.num {
						margin-top: 8rpx;
						font-weight: 600;
						color: #333333;

						&>text:nth-of-type(1) {
							font-size: 48rpx;
						}

						&>text:nth-of-type(2) {
							font-size: 28rpx;
						}
					}
				}
			}
		}

		.echarts {
			width: 91%;
			background-color: #fff;
			margin-left: 32rpx;
			margin-top: 16rpx;
			border-radius: 16rpx;
			margin-bottom: 200rpx;
			padding: 36rpx 24rpx 0 24rpx;

			.title {
				font-size: 32rpx;
				font-weight: 500;
				color: #333333;

				image {
					width: 36rpx;
					height: 36rpx;
					vertical-align: middle;
				}

				&>text {
					margin-left: 14rpx;
				}
			}
		}
	
	}
	.btn{
		width: 100%;
		height: 148rpx;
		background: #FFFFFF;
		display: block;
		position: fixed;
		bottom: 0;
		box-shadow: 0px -4px 8px 0px rgba(0, 0, 0, 0.05);
		.leave{
			width: 686rpx;
			height: 100rpx;
			background: #2674FF;
			border-radius: 8rpx;
			margin-top: 24rpx;
		}
	}
</style>
